<!-- 图文集控件设置面板 -->
<template>
    <el-tabs modelValue="widget" stretch>
        <el-tab-pane :label="`${widget.widgetData.component.title}组件`" name="widget">
            <el-scrollbar>
                <!-- 组件风格 -->
                <row-component-mode :widget="widget" />

                <!-- 样式 -->
                <list-mode :widget="widget" />

                <!-- 列表 -->
                <row-content :widget="widget" />

                <!-- 元素可见设置 -->
                <row-element-visible :widget="widget" />
            </el-scrollbar>
        </el-tab-pane>

        <el-tab-pane label="组件样式" name="style">
            <el-scrollbar>
                <el-collapse modelValue="1">
                    <el-collapse-item title="组件设置" name="1">
                        <!-- 位置 -->
                        <row-position :widget="widget" />

                        <!-- 背景 -->
                        <el-divider></el-divider>
                        <row-background :widget="widget" />

                        <!-- 透明 -->
                        <el-divider></el-divider>
                        <row-opacity :widget="widget" />
                    </el-collapse-item>
                </el-collapse>

                <el-collapse modelValue="1">
                    <el-collapse-item title="图片设置" name="1">
                        <layout-pane label="大小">
                            <si-input-number
                                v-model="widget.widgetData.eles.customFeature.imgWidth"
                                :min="0"
                                label="宽度"
                            />
                            <si-input-number
                                v-model="widget.widgetData.eles.customFeature.imgHeight"
                                :min="0"
                                label="高度"
                            />
                        </layout-pane>

                        <el-divider></el-divider>
                        <layout-pane label="每行">
                            <si-input-number
                                v-model="widget.widgetData.eles.customFeature.lineHeight"
                                :min="0"
                                label="高度"
                            />
                            <si-input-number
                                v-model="widget.widgetData.eles.customFeature.margin"
                                :min="0"
                                label="间距"
                            />
                        </layout-pane>
                    </el-collapse-item>
                </el-collapse>

                <el-collapse modelValue="1">
                    <el-collapse-item title="字体设置" name="1">
                        <row-font-style :widget="widget" />
                    </el-collapse-item>
                </el-collapse>
            </el-scrollbar>
        </el-tab-pane>
    </el-tabs>
</template>

<script>
import { defineComponent, toRefs } from 'vue'
import LayoutPane from '@/components/setting-pane/layout-pane'
import { SiInputNumber } from '@/components/setting-pane/setting-item'
import {
    RowContent,
    RowPosition,
    RowOpacity,
    RowBackground,
    RowFontStyle,
    RowComponentMode,
    RowElementVisible
} from '../../widget-setting-row'
import ListMode from './components/list-mode'
export default defineComponent({
    name: 'ListSetting',
    components: {
        LayoutPane,
        SiInputNumber,
        RowContent,
        RowPosition,
        RowOpacity,
        RowBackground,
        RowFontStyle,
        RowComponentMode,
        RowElementVisible,
        ListMode
    },
    props: {
        widget: {
            type: Object,
            default: () => ({})
        }
    },
    setup(props) {
        const { widget } = toRefs(props)

        return {
            widget
        }
    }
})
</script>
